//
//  NSViewController+XP.m
//  QQ
//
//  Created by nhope on 2017/4/26.
//  Copyright © 2017年 xiaopin. All rights reserved.
//

#import "NSViewController+XP.h"

@implementation NSViewController (XP)

/**
 从Main.storyboard中实例化控制器
 确保`Storyboard ID`和类名保持一致
 
 @return 对应的控制器
 */
+ (instancetype)instantiateControllerFromMainStoryboard {
    NSString *identifier = NSStringFromClass([self class]);
    NSStoryboard *storyboard = [NSStoryboard storyboardWithName:@"Main" bundle:nil];
    return [storyboard instantiateControllerWithIdentifier:identifier];
}

@end
